package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 微信小程序护理项目控制层
 *
 * @Author mr.zhao
 * @Date 2025/5/23 20:04
 */
@RestController
@RequestMapping("/member/orders/project")
public class WechatNursingProjectController extends BaseController {

	@Autowired
	private INursingProjectService nursingProjectService;

	/**
	 * 查询护理项目列表
	 */
	@GetMapping("/page")
	@ApiOperation("查询护理项目列表")
	public TableDataInfo list(@ApiParam(value = "护理项目实体参数，用于筛选查询条件") NursingProject nursingProject)
	{
		startPage();
		List<NursingProject> list = nursingProjectService.selectWechatNursingProjectList(nursingProject);
		return getDataTable(list);
	}

	/**
	 * 获取护理项目详细信息
	 */
	@GetMapping(value = "/{id}")
	@ApiOperation("获取护理项目详细信息")
	public AjaxResult getInfo(@ApiParam(value = "护理项目唯一ID", required = true) @PathVariable("id") Long id)
	{
		return success(nursingProjectService.selectNursingProjectById(id));
	}
}
